#define  _CRT_SECURE_NO_WARNINGS
// class Solution {
// public:
//     bool CheckPermutation(string s1, string s2) {
//         char ch1[26] = {0}, ch2[26] = {0};
//         for(auto e : s1) ch1[e - 'a']++;
//         for(auto e : s2) ch2[e - 'a']++;
//         for(int i = 0; i < 26; i++)if(ch1[i] != ch2[i]) return false;
//         return true;
//     }
// };
class Solution {
public:
    bool CheckPermutation(string s1, string s2) {
        if (s1.size() != s2.size()) return false;
        char ch1[26] = { 0 };
        for (auto e : s1) ch1[e - 'a']++;
        for (auto e : s2) if (ch1[e - 'a']-- == 0) return false;
        return true;
    }
};